package com.miao.util.base.pojo;


import com.miao.util.json.CustomDateSerializer;
import com.miao.util.uuid.UUIDUtils;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.io.Serializable;
import java.util.Date;

public abstract class Basic implements Serializable, Cloneable {

    @JsonIgnore
    protected int id;

    protected String uuid = UUIDUtils.base58Uuid();

    protected RelMap rel = new RelMap();

    protected int isDelete;
    @JsonProperty("create_date")
    @JsonSerialize(using = CustomDateSerializer.class)
    protected Date createDate;
    protected long version;
    @JsonProperty("last_up_date")
    @JsonSerialize(using = CustomDateSerializer.class)
    protected Date lastUpDate;

    @JsonProperty("clazz")
    protected abstract String getClazzType();

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getDelete() {
        return isDelete;
    }

    public void setDelete(int delete) {
        isDelete = delete;
    }

    public Date getLastUpDate() {
        return lastUpDate;
    }

    public void setLastUpDate(Date lastUpDate) {
        this.lastUpDate = lastUpDate;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public long getVersion() {
        return version;
    }

    public void setVersion(long version) {
        this.version = version;
    }

    public RelMap getRel() {
        return rel;
    }

    public void setRel(RelMap rel) {
        this.rel = rel;
    }
}
